Skip to main content

Generation Steps for ValkyrAI


# Follow these steps to generate your API and client code:

1. **Customize Your OpenAPI Specification**
- Edit the 2 OpenAPI spec template files: `src/main/resources/openapi/api.yaml` and `src/main/resources/openapi/api.hbs.yaml`
- Define which endpoints are exposed in `api.yaml`
- Create your detailed Model Schema in `api.hbs.yaml`
- Include ValkyrAI-specific annotations such as `x-thorapi-secure-field` and `x-thorapi-data-field`.
- **ThorAPI will generate the CRUD operations for your schema model objects**

2. **Generate Code**

- **Spring Boot Service**:
- Generate RESTful CRUD APIs with integrated JPA backend.
- **TypeScript Client**:
- Generate a fetch-based API client.
- Include end-to-end validation with Jest testing.

3. **Test the Service Integrations**

- Your generated code may be referenced in other projects, or in the monorepo, update and test all affected code and systems.

- Your APIs may be called from remote systems. You will need to ensure that your versioning reflects breaking changes to your spec, and that you retain backwards compatibility and migration information for all API consumers.

- Ideally, you maintain best practices around communicating changes to your API consumers.

4. **Run the Service**

- Deploy your service as Spring microservices.
- Connect to your preferred database and configure settings as needed.